package stu.sup.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import stu.sup.entity.UserInfo;
import stu.sup.entity.UserInfoExample;

import java.util.List;

public interface UserInfoMapper {
    int countByExample(UserInfoExample example);

    int deleteByExample(UserInfoExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(UserInfo record);

    int insertSelective(UserInfo record);

    List<UserInfo> selectByExample(UserInfoExample example);

    UserInfo selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") UserInfo record, @Param("example") UserInfoExample example);

    int updateByExample(@Param("record") UserInfo record, @Param("example") UserInfoExample example);

    int updateByPrimaryKeySelective(UserInfo record);

    int updateByPrimaryKey(UserInfo record);


    List<UserInfo> findByConditional(UserInfo userInfo);

    /**
     * 根据用户id查询个人信息
     */
    @Select("select i.* from user_info i join user_login l on i.user_login_id = l.id and l.id = #{userLoginId}")
    UserInfo findByUserLoginId(Integer userLoginId);
}